import 'package:flutter/material.dart';

class TestDemo extends StatefulWidget {
  const TestDemo({Key? key}) : super(key: key);

  @override
  State<TestDemo> createState() => _TestDemoState();
}

class _TestDemoState extends State<TestDemo> {
  @override
  Widget build(BuildContext context) {
    // 路由参数
    Map<String, dynamic>? message =
        ModalRoute.of(context)?.settings.arguments as Map<String, dynamic>?;
    print(message);
    return Scaffold(
      appBar: AppBar(
        title: Text(message!["title"]),
        backgroundColor: Colors.pink[200],
        // 阴影
        elevation: 2.0,
        // 文字居中
        centerTitle: true,
      ),
      body: const Text("测试"),
    );
  }
}
